{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!-- 表单头部 -->
                <div class="box-header with-border">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fa fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="box-body">
                        <div class="form-group">
                            <label for="task_id" class="col-sm-2 control-label">子任务ID</label>
                            <div class="col-sm-10 col-md-4">
                                <div class="input-group">
                                    <input id="task_id" name="task_id" value="{$data.task_id|default='0'}" placeholder="请输入子任务id" type="number" class="form-control field-number">
                                </div>
                            </div>
                        </div>
                        <!--<script>-->
                            <!--$('#task_id')-->
                                <!--.bootstrapNumber({-->
                                    <!--upClass: 'success',-->
                                    <!--downClass: 'primary',-->
                                    <!--center: true-->
                                <!--});-->
                        <!--</script>-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                状态
                                <!--1 差价 2 运费-->
                            </label>
                            <div class="col-sm-10 col-md-4" style="padding:5px;">&nbsp;
                                <input type="radio" name="type" value="1" {{if isset($data) && $data.type==1} checked {/if} />&nbsp;差价&nbsp;
                                <input type="radio" name="type" value="2" {if isset($data) && $data.type==2} checked {/if} />&nbsp;运费&nbsp;
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="price" class="col-sm-2 control-label">金额</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="price" name="price" value="{$data.price|default='0.00'}" placeholder="请输入金额" type="text" class="form-control field-text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                状态
                                <!--1 系统 2 站长-->
                            </label>
                            <div class="col-sm-10 col-md-4" style="padding:5px;">&nbsp;
                                <input type="radio" name="source" value="1" {if isset($data) && $data.source==1} checked {/if} />&nbsp;系统&nbsp;
                                <input type="radio" name="source" value="2" {if isset($data) && $data.source==2} checked {/if} />&nbsp;站长&nbsp;
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                状态
                                <!--0 待处理 1 已处理-->
                            </label>
                            <div class="col-sm-10 col-md-4" style="padding:5px;">&nbsp;
                                <input type="radio" name="status" value="0" {if isset($data) && $data.status==0} checked {/if} />&nbsp;待处理&nbsp;
                                <input type="radio" name="status" value="1" {if isset($data) && $data.status==1} checked {/if} />&nbsp;已处理&nbsp;
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="reply_content" class="col-sm-2 control-label">处理内容</label>
                            <div class="col-sm-10">
                                <script id="reply_content" name="reply_content" type="text/plain">{$data.reply_content|raw|default=''}</script>
                            </div>
                        </div>
                        <script>
                            UE.delEditor('reply_content');
                            var UE_reply_content = UE.getEditor('reply_content',{
                                serverUrl :UEServer
                            });
                        </script>
                        <div class="form-group">
                            <label for="reply_time" class="col-sm-2 control-label">处理时间</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="reply_time" readonly name="reply_time" value="{$data.reply_time|default=''}" placeholder="请选择处理时间" type="text" class="form-control filed-datetime">
                            </div>
                        </div>
                        <script>
                            laydate.render({
                                elem: '#reply_time',
                                type: 'datetime',
                            });
                        </script>

                    </div>
                    <!-- 表单底部 -->
                    <div class="box-footer">
                        {:token()}
                        <div class="col-sm-2">
                        </div>
                        <div class="col-sm-10 col-md-4">
                            {if !isset($data)}
                            <div class="btn-group pull-right">
                                <label class="createContinue">
                                    <input type="checkbox" value="1" id="_create" name="_create"
                                           title="继续添加数据">继续添加</label>
                            </div>
                            {/if}
                            <div class="btn-group">
                                <button type="submit" class="btn flat btn-info dataFormSubmit">
                                    保存
                                </button>
                            </div>
                            <div class="btn-group">
                                <button type="reset" class="btn flat btn-default dataFormReset">
                                    重置
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script>
    /** 表单验证 **/
    $('#dataForm').validate({
        rules: {
            'reply_content': {
                required: true,
            },
            'reply_time': {
                required: true,
            },

        },
        messages: {
            'reply_content': {
                required: "处理内容不能为空",
            },
            'reply_time': {
                required: "处理时间不能为空",
            },

        }
    });
</script>
{/block}